<template>
  <div class="baiduMap">
    <div id="allmap"></div>
    <div class="title">
      <i class="icon-xiangzuo" onclick="window.history.go(-1)"></i>
      {{address}}
    </div>
    <!--loading加载-->
    <Loading v-show="loading"></Loading>
  </div>
</template>

<script>

  import {mapGetters} from 'vuex'
  import Loading from 'components/loading/Loading'

  export default {
    data(){
      return{
        address:''
      }
    },
    computed: {
      ...mapGetters([
        'loading'
      ]),
    },
    mounted() {
      this.address = this.$route.params.name
      // 百度地图API功能
      var map = new BMap.Map("allmap");
      var local = new BMap.LocalSearch(map, {
        renderOptions: {map: map}
      });
      local.search(this.$route.params.name);
    },
    components: {
      Loading
    }
  }
</script>

<style scoped lang="stylus" rel="stylesheet/stylus">
  @import "~common/stylus/variable"
  .greetingEdit
    height: 100%;

  .title
    position: fixed;
    top:0;
    left:0;
    right:0;
    height:1.5rem;
    line-height: 1.5rem
    text-align: center;
    font-size: .55rem;
    color: $color-title;
    background: $background;
    z-index: 99;
    padding:0 2rem;
    overflow: hidden;
    text-overflow:ellipsis;
    white-space: nowrap;
    i
      position: absolute;
      top: 0;
      left: .5rem;
      line-height: 1.5rem;
      font-size: .6rem;
      color: $color-l-z;

  .baiduMap
    height: 100%;

  #allmap
    height: 100%;


</style>
